﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xc.DataAccess.Core;
using Xc.DataAccess.HyperTerminalCore.Services;
using Xc.DataAccess.Protocoals.PcpChannels.Services;
using Xc.Logics.HyperTerminalCore.Udp.Models;

namespace Xc.Logics.HyperTerminalCore.Udp.Extensions
{
    internal static class UdpClientOnlineInfoExtension
    {
        /// <summary>
        /// 设置PCP服务
        /// </summary>
        /// <param name="udpClientOnlineInfo"></param>
        public static void SetPcpService(this UdpClientOnlineInfo udpClientOnlineInfo)
        {
            udpClientOnlineInfo.Property = new PcpUpgradeService<UdpChannel>(new UdpChannel(udpClientOnlineInfo));
        }
        /// <summary>
        /// 获取PCP服务
        /// </summary>
        /// <param name="udpClientOnlineInfo"></param>
        /// <returns></returns>
        public static PcpUpgradeService<UdpChannel> GetPcpService(this UdpClientOnlineInfo udpClientOnlineInfo)
        {
            return (PcpUpgradeService<UdpChannel>)udpClientOnlineInfo.Property;
        }
    }
}
